<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 200px;
            height: 200px;
            background-color: rebeccapurple;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div id="app" class="box">1</div>
    <div id="app2" class="box">2</div>
    <div id="app3" class="box">3</div>
    <div id="app4" class="box">4</div>
</body>
<script>
    // 使用获取过来的元素
    var box = document.getElementById("app");
    // 给元素添加文本
    // box.innerText = "啊哈哈"
    //给元素中添加标签
    box.innerHTML= "<h1>啊哈哈哈</h1>";
</script>
</html>